/**
 * Created by Quaye on 2016/12/22.
 */


/************************************
 *       WEBSOCKET STATUS           *
 ***********************************/
var LAM_STATUS = {
    /*** 默认值 ***/
    DEFALUT_VALUE: 0,
    /*** 连接层 状态码 ***/
    ERROR_TRIGGER_CODE: 0,
    /*** 数据层 状态码 ***/
    DATA_ROOM_VERIFY_T: "400",
    DATA_ROOM_VERIFY_F: "401",

    DATA_ROOM_STATUS_T: "410",
    DATA_ROOM_STATUS_F: "411",

    DATA_RANK_LIST_T: "420",
    DATA_RANK_LIST_F: "421",

    DATA_AWARD_LIST_T: "430",
    DATA_AWARD_LIST_F: "431",

    DATA_CUSTOM_MSG_T: "440",
    DATA_CUSTOM_MSG_F: "441"
};
var wsEventArgs = {
    status: LAM_STATUS.DEFALUT_VALUE,
    message: ""
};
/************************************************************************
 *                          发送方名称定义：                            *
 *              主控服务器  ： ["HostSever"]                            *
 *              游戏服务器  ： ["GameSever"]                            *
 *              计算端      ： ["Calculator"]                           *
 ************************************************************************
 *               PUSH               **             GET/POST             *
 *  {                               ** {                                *
 *      Tp: "",                     **      Tp: "",                     *
 *      Ve: "",                     **                                  *
 *      Tm: "",                     **      Tm: "",                     *
 *      To: [""],                   **      To: [""],                   *
 *      Mg: Object,                 **      Mg: Object,                 *
 *  }                               **  }                               *
 ************************************************************************/
/************************************
 *           MESSAGE TYPE           *
 ************************************/
var JISIGHT_LAM_SND_TYPE = {                                 ///***  发送类型码  ***/
    POST_ROOM_VERIFICATION: "31000",
    GET_ROOM_STATUS: "32000",
    PUSH_INTERACTION: "40000"
};

var JISIGHT_LAM_RECV_TYPE = {                                ///***  接收类型码  ***/
    ROOM_VERIFY_T: "31000",
    ROOM_VERIFY_F: "31001",
    ROOM_STATUS_T: "32000",
    ROOM_STATUS_F: "32001",
    RANK_LIST_T: "35000",
    RANK_LIST_F: "35001",
    AWARD_LIST_T: "36000",
    AWARD_LIST_F: "36001",
    CUSTOM_MSG_T: "40000",
    CUSTOM_MSG_F: "40001"
}

/************************************
 *       ROOM VERIFICATION          *
 ************************************/
function MsgPostRoomVerification(_roomId, _gameSign, _selfUserId) { ///***  POST  ***/
    return {
        Tp: JISIGHT_LAM_SND_TYPE.POST_ROOM_VERIFICATION,
        Tm: Date.now(),
        To: ["GameSever"],
        Mg: {
            userId: _selfUserId,
            gameSign: _gameSign,
            roomId: _roomId
        }
    }
}

/************************************
 *            GAME STATUS           *
 ************************************/
function MsgGetGameStatus() {                                       ///***  GET  ***/
    return {
        Tp: JISIGHT_LAM_SND_TYPE.GET_ROOM_STATUS,
        Tm: Date.now(),
        To: ["GameSever"],
        Mg: {}
    }
}
/************************************
 *              H5_PC_H5            *
 ************************************/
//这个是push，回复信息
function MsgPushInteraction(_toUserIds, _message) {                   ///***  PUSH  ***/
    return {
        Tp: JISIGHT_LAM_SND_TYPE.PUSH_INTERACTION,
        Ve: "",
        Tm: Date.now(),
        To: _toUserIds,
        Mg: _message
    }
}



